/* This file is part of Stimer. Stimer - Simple reminder tool.
    Copyright (C) 2012  Klimov Max <cleemmi@gmail.com>

    Stimer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */

#ifndef REMINDERCONTROLLER_H
#define REMINDERCONTROLLER_H

#include "reminder.h"
#include "reminderview.h"
#include "trayview.h"

class ReminderController
{
public:
    ReminderController();
    ReminderController(Reminder *model, ReminderView *view, TrayView *tray);

    void setModel(Reminder *model) { disconnect(); this->model = model; connect(); }
    void setWindowView(ReminderView *view) { disconnect(); this->view = view; connect(); }
    void setTrayView(TrayView *view) { disconnect(); this->tray = view; connect(); }

    const QTime& getTime();
    void setTime(const QTime& time);
    QTime getElapsedTime();
    QTime getStartTime();
    void start();
    void stop();
    void saveSettings();
    void loadSettings();

private:
    Reminder        *model;
    ReminderView    *view;
    TrayView        *tray;

    bool connect();
    bool disconnect();
};

#endif // REMINDERCONTROLLER_H
